package com.cljz.makepassenger.ui.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;

import com.cljz.makepassenger.R;
import com.cljz.makepassenger.model.net.bean.InviteDetailBean;
import com.cljz.makepassenger.ui.holder.PersonListHolder;

import java.util.List;

/**
 * Created by apple on 2017/4/10.
 */

public class PersonListAdapter extends RecyclerView.Adapter<PersonListHolder> {
    private Context context;
    private List<InviteDetailBean.DataBean.InviteBean.MemberBean> personList;

    public PersonListAdapter(Context context, List<InviteDetailBean.DataBean.InviteBean.MemberBean> personList) {
        this.context = context;
        this.personList = personList;
    }


    @Override
    public PersonListHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new PersonListHolder(View.inflate(context, R.layout.item_user_list, null));
    }

    @Override
    public void onBindViewHolder(PersonListHolder holder, int position) {
        holder.setData(personList,position);
    }

    @Override
    public int getItemCount() {
        return personList == null ? 0 : personList.size();
    }

}
